Skip to content

Fix #12643: Pipe structured BuilderProblems into DiagnosticCollector - #12647

Draft
gnodet wants to merge 2 commits into
feature/12571-build-reportfrom
fix/12643-structured-problems
Draft

Fix #12643: Pipe structured BuilderProblems into DiagnosticCollector#12647
gnodet wants to merge 2 commits into
feature/12571-build-reportfrom
fix/12643-structured-problems

Conversation

@gnodet

@gnodet gnodet commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #12572 (Build Report Foundation). This PR implements the structured BuilderProblem pipeline for the 4 pathways identified in the foundation PR, plus a full migration of the PluginValidationManager interface.

Commit 1: Pipe structured BuilderProblems into DiagnosticCollector (Pathways 1–4)

Pathway 1 — Model validation (DefaultModelProblemCollector): already pipes BuilderProblem into DiagnosticCollector at model-build time. Verified existing.

Pathway 2 — Plugin parameter validation (AbstractMavenPluginParametersValidator): 3 validators (DeprecatedPluginValidator, DeprecatedCoreExpressionValidator, ReadOnlyPluginParametersValidator) now create BuilderProblem with structured key, severity, and suggestion, and pipe through PluginValidationManagerDiagnosticCollector.

Pathway 3 — Plugin dependency validation (AbstractMavenPluginDependenciesValidator): 4 validators (Maven2DependenciesValidator, Maven3CompatDependenciesValidator, MavenMixedDependenciesValidator, MavenScopeDependenciesValidator) now create BuilderProblem with structured key and pipe through PluginValidationManagerDiagnosticCollector.

Pathway 4 — Plugin manager Contextualizable check (DefaultMavenPluginManager): creates BuilderProblem with key plugin-validation:contextualizable and pipes through PluginValidationManagerDiagnosticCollector.

Pathway 5 — PluginValidationManager API → BuilderProblem: migrated the interface from String issue to BuilderProblem problem, with deprecated String-based default methods for backward compatibility. Added japicmp exclusion for the intentional API break.

Commit 2: Migrate PluginValidationManager to native BuilderProblem API

  • Changed PluginValidationManager interface: 3 abstract methods now accept BuilderProblem instead of String
  • Added @Deprecated(since = "4.1.0", forRemoval = true) String-based default methods as backward-compat adapters
  • Updated all 9 call sites across 8 files to create BuilderProblem natively
  • Injected DefaultDiagnosticCollector into DefaultPluginValidationManager
  • Added DefaultPluginValidationManager to EXCLUDED_LOGGERS in BuildReportCollector
  • Added japicmp exclusion for intentional API break

Test plan

  • mvn test -pl impl/maven-core — 620 tests pass, 0 failures
  • mvn install -pl api/maven-api-core,impl/maven-core — builds clean including japicmp check
  • Jenkins CI — awaiting results

gnodet and others added 2 commits July 31, 2026 14:58
…ollector

Route structured validation problems from 4 pathways (settings, toolchains,
model validation, graph building) into DefaultDiagnosticCollector so they
appear in the build report with full key/suggestion/documentationUrl metadata
instead of being re-logged as plain text.

Pathways:
- LookupInvoker: settings validation problems
- MavenInvoker: toolchains validation problems
- DefaultProjectsSelector: model validation problems (ModelProblem → BuilderProblem)
- DefaultMaven: graph building problems (ModelProblem → BuilderProblem)

Also adds EXCLUDED_LOGGERS in BuildReportCollector to prevent double-counting
when the same problems are both piped structurally and logged via SLF4J.

Migrates all test files from DefaultBuilderProblem constructor to
BuilderProblem.builder() API.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Change the PluginValidationManager interface from String-based to
BuilderProblem-based, enabling structured problem reporting with keys,
severity, and suggestions throughout the plugin validation pipeline.

- Change 3 abstract report methods from String issue to BuilderProblem
- Add deprecated String-based default methods for backward compat
- Update all 9 call sites (7 validators + 1 plugin manager) to create
  BuilderProblem with structured key, severity, and suggestion
- Inject DefaultDiagnosticCollector into DefaultPluginValidationManager
  to pipe problems into the diagnostic pipeline
- Add japicmp exclusion for the intentional API break
- Add DefaultPluginValidationManager to EXCLUDED_LOGGERS in
  BuildReportCollector to prevent double-counting

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant